package com.hhkj.admin.sale.controller;

import com.hhkj.admin.order.common.cont.OrderConst;
import com.hhkj.admin.sale.common.cont.SaleCommissionConst;
import com.hhkj.admin.sale.domain.SaleCommission;
import com.hhkj.admin.sale.model.req.SaleCommissionReq;
import com.hhkj.admin.sale.model.res.SaleCommissionRes;
import com.hhkj.admin.sale.service.biz.SaleCommissionBizService;
import com.ruoyi.common.annotation.PermissionPrefix;
import com.ruoyi.common.base.biz.controller.v2.BaseController;
import com.ruoyi.common.utils.excl.utils.ExcelUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/sale/commission")
@PermissionPrefix(PermissionPrefix.NO_PERMISSION)
public class SaleCommissionController extends BaseController<SaleCommission, SaleCommissionReq, SaleCommissionRes, SaleCommissionBizService> {

    /** 分佣数据导出 */
    @PostMapping("/export")
    public void export(@RequestBody SaleCommissionReq saleCommissionReq, HttpServletResponse response)
    {
        ExcelUtils.downLoadExcel(SaleCommissionConst.EXPORT_EXCEL_TITLE, response, this.getBizService().createExportWorkbook(saleCommissionReq));
    }
}
